
#include "BaseHttpServer.h"
#include <iostream>
#include <string>

using namespace std;

#define THIS_FILE	"BaseHttpServer"

HttpClientConnection::HttpClientConnection(Proactor* proactor,pj_sock_t newsock):
					  BaseStream(proactor,newsock)
{
}
pj_bool_t HttpClientConnection::OnDataRead(void *data,pj_size_t size,int status,pj_size_t* remainder)
{
	char* p = (char*)data;
	printf("HttpClientConnection::OnDataRead status=%d size=%d\n",status,size);
	if (TcpSocket::OnDataRead(data,size,status,remainder)!= PJ_TRUE)
		return PJ_FALSE;

	return handleMessage0(p,size,remainder);
};
pj_bool_t HttpClientConnection::OnDataSend(pj_ioqueue_op_key_t *send_key,int sendsize)
{
	printf("HttpClientConnection::OnDataSend sendsize=%d\n",sendsize);
	return PJ_TRUE;
};
HttpClientConnection::~HttpClientConnection()
{
	cout << THIS_FILE << " HttpClientConnection::~HttpClientConnection Go!" << endl;
}